import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ZhongJinTao
 * Date: 2024-03-03
 * Time: 14:17
 */
public class IODemo4 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File f = new File("./test.txt");
        boolean ret1 = f.createNewFile();//根据 File对象，⾃动创建⼀个空⽂件。成功创建后返回 true
        System.out.println(ret1);//根据 File 对象，标注⽂件将被删除，删除动作会到 JVM 运⾏结束时才会进⾏
        f.deleteOnExit();
        Thread.sleep(5000);
    }
}
